//   Copyright 2012,2013 Vaughn Vernon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package com.saasovation.agilepm.domain.model;

import com.saasovation.common.AssertionConcern;

/**
 * 表示领域模型的实体
 * 描述：继承自断言关注；和值对象的区别是，多出来并发版本
 * @author learn
 */
public abstract class Entity extends AssertionConcern {

    /**
     * 并发版本
     */
    private int concurrencyVersion;

    /**
     * 默认构造器
     */
    public Entity() {
        // 调用父类构造器
        super();

        // 设置并发版本为0
        this.setConcurrencyVersion(0);
    }

    /**
     * 获取并发版本
     * @return 返回并发版本
     */
    public int concurrencyVersion() {
        return this.concurrencyVersion;
    }

    /**
     * 设置并发版本
     * @param aConcurrencyVersion 并发版本
     */
    private void setConcurrencyVersion(int aConcurrencyVersion) {
        this.concurrencyVersion = aConcurrencyVersion;
    }
}
